import {createBrowserRouter} from "react-router-dom";
import Layout from "../pages/Layout";
import Login from "../pages/Login";
import NotFound from "@/components/NotFound";
import Test from "@/pages/Test";
import ChildPropsA from "@/pages/Test/components/ChildPropsA";
import Home from "@/pages/Layout/Home";
import Article from "@/pages/Layout/Article";
import Publish from "@/pages/Layout/Publish";
import Test1 from "@/pages/Layout/Test1";
import FormTest from '@/pages/Layout/FormTest'
import LayoutStudy from '@/pages/Layout/LayoutStudy'

// 通过createBrowserRouter创建一个router对象
const router=createBrowserRouter([
    {
        path:'/',
        element:<Layout/>,
        children:[
            {
                path: '/',
                element: <Home/>
            },
            {
                path: '/article',
                element: <Article/>
            },{
                path: '/publish',
                element: <Publish/>
            },{
                path: '/test1',
                element: <Test1/>
            },
            {
                path: '/formTest',
                element: <FormTest/>
            },
            {
                path: '/layoutStudy',
                element: <LayoutStudy/>
            },
        ]
    },
    {
        path:'/login',
        element:<Login/>
    },
    {
      path:'/test',
      element:<Test/>,
        children:[
            {
                path:'/test/child',
                element:<ChildPropsA/>
            }
        ]
    },
    {
        path:'*',
       element:<NotFound/>

    }
])


export default router;